package org.fast.develop.logicflow.runtime;

import org.fast.develop.logicflow.builder.LogicFlowBuilder;
import org.fast.develop.logicflow.core.LogicFlowConfiguration;

import java.util.UUID;

/**
 * @author 莫寅
 * @createTime 2022-11-24 12:03
 * @desc：
 */
public class LogicFlow {

    private static LogicFlow logicFlow;

    public static LogicFlow getInstance() {
        if (logicFlow == null) {
            logicFlow = new LogicFlow();
        }
        return logicFlow;
    }

    public static LogicFlowBuilder createExecutableProcess() {
        return createExecutableProcess(UUID.randomUUID().toString());
    }

    public static LogicFlowBuilder createExecutableProcess(String processId) {
        return new LogicFlowBuilder(LogicFlowConfiguration.getInstance()).id(processId);
    }
}
